home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7439 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.u-net.com!news
  2. From: charlotte@parmo.u-net.com (Thomas Christensen)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Derived class not calling overloaded base class function
  5. Date: Fri, 23 Feb 1996 09:55:47 GMT
  6. Organization: U-NET limited
  7. Message-ID: <4gk310$pqt@nuntius.u-net.net>
  8. References: <4g46t2$3vd@otis.netspace.net.au>
  9. Reply-To: thc@mailhost.net
  10. NNTP-Posting-Host: parmo.u-net.com
  11. X-Newsreader: Forte Free Agent v0.55
  12.  
  13. TorrBoy@Netspace.net.au (Peter J. Torr) wrote:
  14.  
  15. >Hi,
  16.  
  17. >Hopefully a very simple question someone can answer for me!
  18.  
  19. >I have a class, say 'foo' (everyone's favourite) which has a member function 
  20. >'int Get(void)'
  21.  
  22. >I then derive a class (say 'goo') which has as a base class foo. If goo has a 
  23. >function also called Get, but with different params (say ''char *Get(char *)') I can't 
  24. >seem to get the base class' Get() function to operate within the derived class.
  25.  
  26. >If I say just plain "Get()" it says too few parameters (for Get(char *)". If I use 
  27. >"::Get()" the compiler complains Get should have a prototype. If I say "foo.Get()" it 
  28. >says improper use of typedef foo. The only way seems to be to explicitly cast the 
  29. >this pointer to a foo.
  30.  
  31. >Surely there is a better way than this? Thanks for any help (e-mail preferred)
  32.  
  33. >Peter
  34.  
  35. Hi Peter
  36.  
  37. Have you tried foo::Get() ?
  38.  
  39. Thomas Christensen
  40. E-mail: thc@mailhost.net
  41.  
  42.